﻿using System.Linq;
using System.Text.RegularExpressions;
using Gp.Scripts.Core;
using QFramework;

namespace Gp.Scripts.Core {
    public static class InventoryUtils {
        
        // private static MoreMountains.InventoryEngine.Inventory GetPlayerInventory() {
        //     var targetInventory =
        //         MoreMountains.InventoryEngine.Inventory.FindInventory(PlayerConst.InventoryName,
        //             PlayerConst.PlayerName);
        //
        //     if (targetInventory == null) {
        //         throw new Exception($"{PlayerConst.InventoryName} , {PlayerConst.PlayerName} 未找到目标Inventory");
        //     }
        //
        //     return targetInventory;
        // }

        // public static MoreMountains.InventoryEngine.Inventory GetNpcInventory(string name, string npcName)
        // {
        //     var target = MoreMountains.InventoryEngine.Inventory.FindInventory(name, npcName);
        //     if (target == null) {
        //         throw new Exception($"{PlayerConst.InventoryName} , {PlayerConst.PlayerName} 未找到目标Inventory");
        //     }
        //
        //     return target;
        // }


        /// 判断一个字符串是否为id格式
        public static bool IsIdFormat(string str) {
            // id 格式为16进制字符
            return Regex.IsMatch(str,"^[A-Fa-f0-9]+$");
        }
        
        

    }
}